package com.huiquan.body.domain;

public class BodyOrgan {

    private Long id;
    /**
     * 名称.
     */
    private String name;
    /**
     * 性别：0-无，1-男，2-女.
     */
    private Integer sex;
    /**
     * 上级id.
     */
    private Long parentId;
    /**
     * 排序字段.
     */
    private String rank;
    /**
     * 图片.
     */
    private String picture;
    /**
     * 图片前缀.
     */
    private String picturePre;

    /**
     * 排序数值
     */
    private Integer rankNum;

    public BodyOrgan() {
    }

    public BodyOrgan(String name, Integer sex, Long parentId, String rank) {
        this.name = name;
        this.sex = sex;
        this.parentId = parentId;
        this.rank = rank;
        this.rankNum = 0;
        String[] rankNums = rank.split(";");
        for (int i = 0; i < rankNums.length; i++) {
            if (i == 0) {
                this.rankNum += Integer.valueOf(rankNums[i]) * 10000;
            } else if (i == 1) {
                this.rankNum += Integer.valueOf(rankNums[i]) * 100;
            } else if (i == 2) {
                this.rankNum += Integer.valueOf(rankNums[i]);
            }
        }
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getSex() {
        return sex;
    }

    public void setSex(Integer sex) {
        this.sex = sex;
    }

    public Long getParentId() {
        return parentId;
    }

    public void setParentId(Long parentId) {
        this.parentId = parentId;
    }

    public String getRank() {
        return rank;
    }

    public void setRank(String rank) {
        this.rank = rank;
    }

    public String getPicture() {
        return picture;
    }

    public void setPicture(String picture) {
        this.picture = picture;
    }

    public String getPicturePre() {
        return picturePre;
    }

    public void setPicturePre(String picturePre) {
        this.picturePre = picturePre;
    }

    public Integer getRankNum() {
        return rankNum;
    }

    public void setRankNum(Integer rankNum) {
        this.rankNum = rankNum;
    }
}